home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / utils / sound / players / unix / rplay / readme < prev    next >
Encoding:
Text File  |  1992-11-12  |  3.5 KB  |  139 lines

  1. This is rplay2.0 which provides the ability to rplay sounds on both
  2. local and remote Sun workstations with sound support.  This version
  3. of rplay is not compatible will the older versions of rplay but
  4. as you will see it is much better.  For installation instructions
  5. see INSTALL.
  6.  
  7. Major features of rplay2.0:
  8.     - Sounds are no longer indexed by id, the sound names are now used.
  9.  
  10.     - Sounds can be played, paused, continued, and stopped.
  11.  
  12.     - Each sound can have a volume associated with it.  A volume is
  13.       a number between 0 and 255 and it is relative to the actual volume
  14.       of the audio device.
  15.  
  16.     - Sequences of sounds are supported.  This is useful for playing
  17.       sentences or sounds that need to be played sequentially.
  18.  
  19.     - mmap is now used to read sounds.  This increases performance
  20.       and saves a lot of memory.  Thanks to stripes@pix.com for this
  21.       suggestion.
  22.  
  23.     - Broadcasting sounds.  To use this just use a broadcast address
  24.       instead of a hostname.  For example, I use:
  25.         rplay 130.191.255.255 burp.au
  26.       to play burp.au on all our machines running rplayd on our subnet.
  27.  
  28.     - The Sun audio stuff is no longer used.  Thanks to libst.c and 
  29.       libst.h from Sound Tools.  See these files for more information.
  30.  
  31. Now that sound ids are not used, the rplay.conf file is just a list of
  32. pathnames for all the sound files.  I run the following cron job to update
  33. my rplay.conf file every morning:
  34.  
  35. 57 5 * * * find /usr/local/sounds -name '*.au' -print > /usr/local/etc/rplay.conf
  36.  
  37. The new rplay library includes the following functions:
  38.  
  39.     RPLAY    *rplay_create() - create an rplay packet
  40.  
  41.     rplay_destroy(rp) - free memory used by rp
  42.     RPLAY    *rp;
  43.  
  44.     rplay_set(rp, ...) - set rplay attributes
  45.     RPLAY    *rp;
  46.  
  47.     int rplay_open(host) - return a UDP socket for the host
  48.     char    *host;
  49.  
  50.     rplay(rplay_fd, rp) - send a rplay packet to a host
  51.     int    rplay_fd;
  52.     RPLAY    *rp;
  53.  
  54.     rplay_close(rplay_fd) - close the UDP socket
  55.     int    rplay_fd;
  56.  
  57.     rplay_perror(s) - report an rplay error to stderr
  58.     char    *s;
  59.  
  60. Here are some examples using the rplay library:
  61.  
  62.     int    rplay_fd;
  63.     RPLAY    *rp;
  64.  
  65.     rp = rplay_create();
  66.     if (rp == NULL) {
  67.         rplay_perror("rplay_create");
  68.         exit(1);
  69.     }
  70.  
  71.     rplay_fd = rplay_open("sounds.sdsu.edu");
  72.     if (rplay_fd < 0) {
  73.         rplay_perror("rplay_open");
  74.         exit(1);
  75.     }
  76.  
  77.     /*
  78.      * play one sound
  79.      */
  80.     rplay_set(rp, RPLAY_PLAY,
  81.         "burp.au",
  82.         NULL);
  83.     rplay(rplay_fd, rp);
  84.  
  85.     /*
  86.      * play the list of sounds sequentially 
  87.      */
  88.     rplay_set(rp, RPLAY_PLAY,
  89.         "burp.au",
  90.         "beep.au",
  91.         "boom.au",
  92.         "Passing_Train.au",
  93.         NULL);
  94.     rplay(rplay_fd, rp);
  95.  
  96.     /*
  97.      * set one sound then append another
  98.      */
  99.     rplay_set(rp, RPLAY_PLAY,
  100.         "burp.au",
  101.         NULL);
  102.     rplay_set(rp, RPLAY_APPEND_PLAY,
  103.         "beep.au",
  104.         NULL);
  105.     rplay(rplay_fd, rp);
  106.  
  107.     /*
  108.      * play a sound with a volume
  109.      */
  110.     rplay_set(rp, RPLAY_VOLUME_PLAY,
  111.         "burp.au",    255,
  112.         NULL);
  113.     rplay(rplay_fd, rp);
  114.  
  115.     /*
  116.      * stop a sound that is playing
  117.      */
  118.     rplay_set(rp, RPLAY_STOP,
  119.         "burp.au",
  120.         NULL);
  121.     rplay(rplay_fd, rp);
  122.  
  123. There are more rplay attributes that can be used with rplay_set, see
  124. rplay.h for the list.  It is very important that you always NULL terminate
  125. the rplay_set argument list.  One other thing that might be peculiar is
  126. that when stopping, pausing, and continuing sound lists, the exact sound
  127. list must be sent to rplayd.
  128.  
  129. I have used rplay to add sounds to many programs, patches will soon be
  130. available for the newest version of xtank.
  131.  
  132. If you are looking for sound files, sounds.sdsu.edu has about 300 Megs of
  133. sound files available via anonymous ftp.
  134.  
  135. Have fun, let me know of any problems or suggestions.
  136.  
  137. Mark
  138. boyns@sciences.sdsu.edu
  139.